import { optionsToMap } from '@/utils'

export const rejectTypeOptions = [
  { label: '营业执照照片模糊', value: 1 },
  { label: '银行开户许可证照片模糊', value: 2 },
  { label: '身份证国徽面照片模糊', value: 3 },
  { label: '身份证人像面照片模糊', value: 4 },
  { label: '手持身份证照片模糊', value: 5 }
] as OptionItem[]

export const rejectTypeOptionsMap = optionsToMap(rejectTypeOptions)

export function getRejectTypeStr(auditDetailType: string): string {
  if (auditDetailType) {
    const types = auditDetailType.split(',')
    const list = [] as string[]
    if (types.length > 0) {
      types.forEach(item => {
        list.push(rejectTypeOptionsMap[Number(item)])
      })
    }
    return ' [ ' + list.join(' , ') + ' ] '
  }
  return ''
}
